home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / GoodBye / JohnKennedy / December94.lha / crimbo2.lha / master.doc < prev   
Encoding:
Text File  |  1994-10-14  |  12.3 KB  |  358 lines

  1. AmigaDos MasterClass - December 1994
  2.  
  3.  
  4.  
  5. You've probably seen them, you've probably used them - noew
  6. John Kennedy explains how to write them: AmigaGuide
  7. documents.
  8.  
  9.  
  10.  
  11. Despite what you might think, Commodore do occasionally have
  12. good ideas, and there are three which really stick out when
  13. I use my system. The first brainwave was to make ARexx part
  14. of the Workbench with release 2.04 upwards. As we saw last
  15. month, ARexx helps make the most of the Amiga's operating
  16. system and opens up all sorts of possibilities which
  17. other platforms can only dream about.
  18.  
  19. The second idea was to create Installer - a user-friendly
  20. and universally supported program for installing software
  21. onto hard disks. Any vendor (shareware, freeware or
  22. commercial) can supply Installer and use an easy-to-write
  23. script that makes setting up applications and games a
  24. pleasure.
  25.  
  26. The third idea was AmigaGuide - the hypertext, on-line help
  27. and documentation system. Now this was a really Good Thing -
  28. at last a standard way of displaying documents without all
  29. the silly hassles of using text display programs like More
  30. and PPMore. It's not new - there are similar systems on the
  31. PC and Mac, but in the typical Amiga way, it's better.
  32.  
  33. AmigaGuide can be used as nothing more than a text display
  34. system, but when you start to use the embedded command codes
  35. you can do all sorts - from making on-line help files to
  36. interactive stories and even adventure games. I've also seen
  37. an Internet Gopher tool written using AmigaGuide.
  38.  
  39. The 'hypertext' system is growning in popularity all the
  40. time: one american company even tried to patent it, which
  41. would have been interesting. If you have seen or used
  42. Mosaic, the World Wide Web browser, you'll have an idea what
  43. is possible.
  44.  
  45.  
  46.  
  47. Write your own
  48. --------------
  49.  
  50.  
  51. Writing your own AmigaGuide document is easy, but the first
  52. thing to make sure of is that you have the AmigaGuide
  53. display program or you'll be wasting your time. Hunt around
  54. on your Workbench 3.0 disks for it, and make sure the
  55. Amigaguide datatype is installed - this way you can use
  56. Multiview to examine your documents.
  57.  
  58. If you don't have Workbench 3 (i.e. you don't have an A1200
  59. or A4000 or an upgrade) hunt around for anything that says
  60. AmigaGuide on some of your existing software. 
  61.  
  62. (picture: guide1.jpg)
  63. (caption: AmigaGuide is an easy to use hypertext system.
  64. Many programs use it for on-line help.)
  65.  
  66. AmigaGuide looks like figure 1 when it is running. The
  67. 'buttons' are added by special codes embedded in the
  68. document - an AmigaGuide file is nothing more than a text
  69. file with some special codes in it. You can create it with
  70. Ed, or CygnusEd or GoldEd or anyother plain ASCII text
  71. editor.
  72.  
  73. The controls at the top are added automatically by the
  74. AmigaGuide system. Normally the window will open on the
  75. Workbench, and assume the largest size possible - but you
  76. can re-size it and push it backwards and forwards as
  77. necessary.
  78.  
  79. Here is the text behind that first example. 
  80.  
  81. -----------------------------------------------------------------
  82.  
  83. @database "example"
  84. @author "John Kennedy"
  85. @(c) "Copyright © 1992 Commodore-Amiga, Inc. & 1994 John Kennedy"
  86. @$VER: Example 0.1 (14/10/94)
  87.  
  88. @wordwrap
  89.  
  90. @Node Main "Welcome"
  91. @{b}@{fg highlight}The CU Amiga Example Document @{fg text}@{ub}
  92.  
  93. @{" 1. Button 1 " link ex-1}
  94. @{" 2. Button 2 " link ex-2}
  95. @{" 3. Button 3 " link ex-3}
  96.  
  97. @ENDNODE
  98.  
  99. -----------------------------------------------------------------
  100.  
  101. As you can see, the special AmigaGuide codes appear after
  102. the '@' signs. There are two types - commands like
  103. 'database' and 'wordwrap', and attributes: which always are
  104. enclosed in curly brackets. Some code are pretty obvious,
  105. others need a little more explaination. 
  106.  
  107. The file must start with the Database word. The database is
  108. simply the name of the file, and the author - well that's
  109. you. This sort of information is only entered once at the
  110. start of the file - think of it as a way of keeping track of
  111. your AmigaGuide experiments.
  112.  
  113. AmigaGuide works by creating different 'pages' of
  114. information. These pages contain text, but also links to
  115. other pages. Whenever you click on the links the relevant
  116. page is displayed. It is also possible to move between pages
  117. using the buttons at the top of the page, but this is
  118. handled automatically.
  119.  
  120. Each page is called a 'node' in AmigaGuide parlance, and to
  121. create one you simply use the command @Node followed by the
  122. node name and the title of the new page.
  123.  
  124. In the example, the Node is called 'Main' because it will be
  125. the first page that is display. Always remember to call your
  126. first page Main or nothing will be displayed! The title will
  127. appear in the title bar of the AmigaGuide window.
  128.  
  129. Every node must have a matching Endnode - and sure enough,
  130. that's the last line in the example. In between Node and
  131. Endnode, there are a few tricky looking lines.
  132.  
  133. The first line after Node isn't so bad when you realise that
  134. everything in the curly brackets is a special AmigaGuide
  135. attribute code (see the box out for details). You should be
  136. able to see that this line switched on bold text, and then
  137. alters the colour. The text is then displayed on-screen, and
  138. the bold and colour modes switched off. It is important to
  139. remember that any text that appears by itself - without
  140. codes - will be displayed on-screen.
  141.  
  142. The next three lines are all links to other (currently
  143. non-existant nodes). At this point it becomes obvious that
  144. planning your document from the outset it important, and it
  145. is worth sketching down a few ideas.
  146.  
  147. Are you going to have the entire thing menu driven from the
  148. start? This is quite a good way - all you need to do is
  149. create a link to every page in the document, and the user
  150. will quickly and easily be able to find their way to it.
  151.  
  152. Alternatively, you might want to create plain text with
  153. occasional words acting as links - this approach is called
  154. 'hypertext' or 'non sequential reading' - and it is useful
  155. when you use a lot of jargon in your work. If the user wants
  156. more information, they can click on the high-lighted word
  157. and a page containing more information or a definition will
  158. be displayed.
  159.  
  160. Finally, you may want to create gadgets at the bottom of the
  161. page for navigation purposes. For example, in a maze game
  162. the words would be North, South, East and West - and a click
  163. on each would bring the reader to a new page containing a
  164. new description of your surroundings. You might want the use
  165. to be able to skip several pages by creating a fast-forward
  166. and reverse button at the bottom the page.
  167.  
  168. The best documents are a collection of all three methods. If
  169. you have time, it is especially useful if you include an
  170. alphabetical index in your document, highlighting all the
  171. important words and phrases - more on this later.
  172.  
  173.  
  174. Adding buttons
  175.  
  176.  
  177.  
  178. The first link line in the document looks like this:
  179.  
  180. @{" 1. Button 1 " link ex-1}
  181.  
  182. The text in the quotation marks is the text which will be
  183. highlighted on-screen: the text which the user can click on
  184. with the mouse.
  185.  
  186. The text after the word 'link' is the name of the node that
  187. the AmigaGuide system should move to and display if the text
  188. is clicked. In this example, if the user clicks on the text
  189. '1. Button 1' then the node/page called 'ex-1' will be
  190. displayed.
  191.  
  192. Here is our example again, but this time with a new node
  193. which can be jumped to:
  194.  
  195. -----------------------------------------------------------------
  196.  
  197. @database "example"
  198. @author "John Kennedy"
  199. @(c) "Copyright © 1992 Commodore-Amiga, Inc. & 1994 John Kennedy"
  200. @$VER: Example 0.1 (14/10/94)
  201. @wordwrap
  202. @Node Main "Welcome"
  203. @{u}@{fg shine}The CU Amiga Example Document @{fg text}@{uu}
  204.  
  205. @{" 1. Button 1 " link ex-1}
  206. @{" 2. Button 2 " link ex-2}
  207. @{" 3. Button 3 " link ex-3}
  208.  
  209. @ENDNODE
  210.  
  211.  
  212. @node ex-1 "This is Page 1"
  213.  
  214. Welcome to page 1. Page 1 has always been my favourite page,
  215. as it offers the promise of much better stuff to come.
  216.  
  217. @endnode
  218.  
  219. -----------------------------------------------------------------
  220.  
  221.  
  222. You can continue to add more and more pages like this. In
  223. fact, you might find it easier to write the text first, and
  224. then go back and add all the AmigaGuide codes. There are
  225. even some utilitiy programs which attempt to make converting
  226. existing documents into AmigaGuide format easier.
  227.  
  228. Adding links to words which are contained in sentences isn't
  229. hard. Here is how to add another link to the word 'promise':
  230.  
  231.  
  232. -----------------------------------------------------------------
  233.  
  234. Welcome to page 1. Page 1 has always been my favourite page,
  235. as it offers the @{"promise" link promise-page} of much
  236. better stuff to come.
  237.  
  238. -----------------------------------------------------------------
  239.  
  240. (picture:guide2.jpg)
  241. (caption: Even words in sentences can be made into links -
  242. clicking on 'promise' will display a definition.)
  243.  
  244. You can see that the text 'promise' will become highlighted,
  245. and clicking on it will move it the page called
  246. 'promise-page'. This is how you can create a list of
  247. definitions for words. Readers who know what the words
  248. already mean won't have to re-read tedious explainations,
  249. but new users can find out what is going on.
  250.  
  251. The buttons at the top of the screen include two called
  252. CONTENTS and INDEX. The Contents button will light whenever
  253. the user moves away from the MAIN page - and if they click on it,
  254. the main page will be redisplayed.
  255.  
  256. In this way, no matter where they are in the document, there
  257. is always a quick way back home to the start.
  258.  
  259. Likewise, if you create an index page make sure to call it
  260. Index - if you do, the Index button will light and the user
  261. can move there immediately as well.
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. New and Improved
  269.  
  270.  
  271. If you are using a newer version of AmigaGuide (v40 or
  272. better) there are extra codes available for you to use. To
  273. discover which version you have, select ABOUT from the menu.
  274. Keep a look out for newer versions of the AmigaGuide
  275. datatype on existing software.
  276.  
  277. As well as extra codes, the improved AmigaGuide can handle
  278. pictures and ARexx commands as well - which means it can do
  279. just about everything. Here are some useful new commands:
  280.  
  281. @SMARTWRAP is new and replaces WORDWARP. It is better than
  282. previous versions, so use it if you can.
  283.  
  284. @ONOPEN will execute an ARexx script when the node (page) is first
  285. displayed.
  286.  
  287. @ONCLOSE will execute an ARexx script then the node is
  288. closed.
  289.  
  290. @PLAIN switches off all italic, bold and underlined options
  291. quicky and easily.
  292.  
  293. @NEXT
  294. @PREVIOUS
  295. @RETRACE   All are used to provide you with a way of make
  296. buttons which emulate the options at the top of the screen.
  297.  
  298. There are various other options for altering the font, and
  299. incorporating graphics but these will have to wait for
  300. another time... in other words, I haven't got them working
  301. yet!
  302.  
  303.  
  304.  
  305.  
  306.  
  307. Running your AmigaGuide document
  308. --------------------------------
  309.  
  310.  
  311.  
  312. If you have found the AmigaGuide tool in your workbench
  313. directories, you can use it you display your documents. Find
  314. the icon for the document, and double-click on the
  315. AmigaGuide tool - hey presto, up it should pop.
  316.  
  317. Alternatively, find the icon for the document and change the
  318. tool type to read AmigaGuide. If this doesn't work, try
  319. using Multiview instead, as Multiview can read AmigaGuide
  320. documents (using the datatype) as well as displaying
  321. pictures, animations and sound. In fact, Multiview and
  322. Datatype are two more of Commodore's Good Ideas.
  323.  
  324.  
  325. (picture:guide3.jpg)
  326. (caption:Use the Workbench INFORMATION menu option to change
  327. the default tool of the document to be AmigaGuide. If this
  328. doesn't work, try MULTIVIEW (if you have Workbench 3 and the
  329. AmigaGuide datatype installed.)
  330.  
  331.  
  332.  
  333.  
  334.  
  335. Box Out - Amiga Guide Options (all versions)
  336. --------------------------------------------
  337.  
  338. @WordWrap               Switch on word-wrapping facility
  339. @{b}                    Switch on bold text
  340. @{ub}                   Switch off bold text
  341. @{i}                    Switch on bold text
  342. @{ui}                   Switch off bold text
  343. @{u}                    Switch on underlined text
  344. @{uu}                   Switch off underlined text
  345. @{fg <flag>}            Switch foreground text to colour specifed by flag*
  346. @{bg <flag>}            Switch background text to colour specifed by flag*
  347. @{fg text}              Switch text to normal colour
  348. @Node <name> <text>     Start a 'node' or page of text.
  349. @Endnode                Stop a node.
  350. @{ <text> link <node>   Create a link to a node.
  351. @font <font> <size>     Start use the font with given size
  352. @help                   The node displayed when the user presses HELP
  353. @index                  The node displayed when the user clicks on CONTENTS
  354. @title                  The text displayed at the top of the page.
  355.  
  356.  
  357. * Text options include: Shine, Shadow, Fill, FillText,
  358. Background, Highlight